<template>
  <div class="u-page u-general-color">
    <u-navbar :title="title" :background="background" :border-bottom="false" :title-bold="true" title-color="#040503"
              back-icon-color="#040503"></u-navbar>
    <section class="aui-flexView">
      <section class="aui-scrollView">
        <div class="aui-order-box">

          <!-- 基本信息 -->
          <div class="aui-flex aui-choice-white b-line u-font-bold u-pt-20 gap-container">
            <div class="gap-content">
              基本信息
            </div>
            <u-image class="gap-icon" width="40rpx" height="40rpx"
                     v-if="basicFormDisabled"
                     src="https://www-1308272144.cos.ap-guangzhou.myqcloud.com/Meily/img/customer_info_edit.png"
                     @click="basicFormDisabled = false"
            ></u-image>
            <div class="gap-save-btn" v-else @click="Save">
              保存
            </div>
          </div>

          <!-- 用户id -->
          <div class="aui-flex aui-choice-white aui-mar15 b-line">
            <div class="aui-flex-box">平台ID</div>
            <u-input user-select='true' disabled="true" v-model="form.userId" input-align="right" placeholder="用户id"
                     @longpress='longpressCopy(form.userId,"用户id已复制")'></u-input>
          </div>

          <!-- 微信昵称 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">平台昵称</div>
            <u-input disabled="true" v-model="form.userName" input-align="right" placeholder="微信昵称"
                     @longpress='longpressCopy(form.NickName,"微信昵称已复制")'></u-input>
          </div>

          <!-- 手机号码 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">关联手机</div>
            <div class="u-text-right" v-if="form.phoneNumber">
              <u-input :disabled="basicFormDisabled" v-model="form.phoneNumber" input-align="right"
                       placeholder="请填写手机号码"
                       @longpress='longpressCopy(form.phoneNumber,"手机号码已复制")'></u-input>
            </div>
            <div class="u-text-right" v-else>
              <u-button type="clear" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
								<span class="u-cl-primary u-pointer u-font-underline">
									点击获取
								</span>
              </u-button>
            </div>
          </div>

          <!-- 真实姓名 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">真实姓名</div>
            <u-input :disabled="basicFormDisabled" v-model="form.realName" input-align="right"
                     placeholder="建议填写真实名字"></u-input>
          </div>

          <!-- 性别 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">性别</div>
            <u-input :disabled="basicFormDisabled" v-if="basicFormDisabled" v-model="form.sex"
                     input-align="right"></u-input>
            <u-input v-else type="select" v-model="form.sex" input-align="right" placeholder="请选择"
                     @click="visible1 = true"></u-input>
          </div>
          <u-select :list="SexList" @confirm="(event) => (form.sex = event[0].value)"
                    v-model="visible1" confirm-color="#eb5468"></u-select>

          <!-- 年龄层 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">年龄层</div>
            <u-input :disabled="basicFormDisabled" v-if="basicFormDisabled" v-model="form.ageGroup"
                     input-align="right"></u-input>
            <u-input v-else type="select" v-model="form.ageGroup" input-align="right" placeholder="请选择"
                     @click="visible2 = true"></u-input>
          </div>
          <u-select :list="AgeGroupList" @confirm="(event) => (form.ageGroup = event[0].value)"
                    v-model="visible2" confirm-color="#eb5468"></u-select>

          <!-- 个人介绍 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">
              <div class="aui-flex-box">个人介绍</div>
              <div style="width: auto;margin-top: 10px;">
                <u-input
                    :disabled="basicFormDisabled"
                    type="textarea"
                    placeholder="请丰富您的个人介绍，如能力优势、掌握技能、性格爱好、擅长领域等。"
                    maxlength="-1"
                    height="100"
                    v-model="form.introduction"
                ></u-input>
              </div>
            </div>
          </div>

          <!-- 所在地区 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">所在地区</div>
            <u-input :disabled="basicFormDisabled" v-if="basicFormDisabled" v-model="form.region"
                     input-align="right"></u-input>
            <u-input v-else type="select" v-model="form.region" input-align="right" height="100" placeholder="请选择"
                     @click="area_show = true"/>
            <u-picker mode="region" confirm-color="#eb5468" v-model="area_show" :default-selector="[0]"
                      @confirm="confirmRegion"></u-picker>
          </div>

          <!-- 所在街道 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">所在街道</div>
            <u-input :disabled="basicFormDisabled" v-if="basicFormDisabled" v-model="form.streetVillage"
                     input-align="right"></u-input>
            <u-input v-else type="select" v-model="form.streetVillage" input-align="right" height="100"
                     placeholder="请选择"
                     @click="street_show = true"/>
            <u-select v-model="street_show" mode="mutil-column-auto" :list="list" @confirm="confirm"></u-select>
          </div>

          <!-- 详细地址 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">
              <div class="aui-flex-box">详细地址</div>
              <div style="width: auto;margin-top: 10px;">
                <u-input
                    :disabled="basicFormDisabled"
                    type="textarea"
                    placeholder="请务必填写详细地址，以防包裹丢失。如：保利花园一期11栋1104或保利花园一期菜鸟驿站。"
                    maxlength="-1"
                    height="100"
                    v-model="form.address"
                ></u-input>
              </div>
            </div>
          </div>

          <!-- 身份职业 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">身份职业</div>
            <u-input :disabled="basicFormDisabled" v-if="basicFormDisabled" v-model="form.identityJob"
                     input-align="right" placeholder=" "></u-input>
            <u-input v-else type="select" v-model="form.identityJob" input-align="right" placeholder="请选择"
                     @click="visible3 = true"></u-input>
          </div>
          <u-select :list="IdentityJobList" @confirm="(event) => (form.identityJob = event[0].value)"
                    v-model="visible3" confirm-color="#eb5468"></u-select>

          <!-- 月收入 -->
          <div class="aui-flex aui-choice-white b-line">
            <div class="aui-flex-box">月收入</div>
            <u-input :disabled="basicFormDisabled" v-if="basicFormDisabled" v-model="form.monthlyIncome"
                     input-align="right" placeholder=" "></u-input>
            <u-input v-else type="select" v-model="form.monthlyIncome" input-align="right" placeholder="请选择"
                     @click="visible6 = true"></u-input>
          </div>
          <u-select :list="MonthlyIncomeList" @confirm="(event) => (form.monthlyIncome = event[0].value)"
                    v-model="visible6" confirm-color="#eb5468"></u-select>

          <!-- 以上是基本信息 -->

          <!-- 角色申请 -->
          <div class="aui-flex aui-choice-white b-line u-font-bold u-pt-20 gap-container"
               v-if="!provider.id || !editBtn_show">
            <div class="gap-content">
              角色申请
            </div>
            <u-image class="gap-icon" width="40rpx" height="40rpx"
                     src="https://www-1308272144.cos.ap-guangzhou.myqcloud.com/Meily/img/customer_info_add.png"
                     @click="identity_show = true"
            ></u-image>
          </div>

          <!-- 区域服务商 -->
          <div v-if="provider.id">
            <div class="aui-flex aui-choice-white b-line u-font-bold u-pt-20 gap-container">
              <div class="gap-content">
                区域服务商
              </div>
              <u-image class="gap-icon" width="40rpx" height="40rpx"
                       src="https://www-1308272144.cos.ap-guangzhou.myqcloud.com/Meily/img/customer_info_edit.png"
                       @click="openCustomerService_show = true"
              ></u-image>
            </div>
            <div>

              <!-- 服务类型 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">服务类型</div>
                <div>{{ provider.storeType ? provider.storeType : '' }}</div>
              </div>

              <!-- 服务商名称 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">服务商名称</div>
                <div>{{ provider.storeName ? provider.storeName : '' }}</div>
                <!-- <u-input v-model="provider.storeName" input-align="right" disabled="true"></u-input> -->
              </div>

              <!-- 区域编号 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">区域编号</div>
                <div>{{ provider.providerId ? provider.providerId : '' }}</div>
              </div>

              <!-- 所在地区 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">所在地区</div>
                <div>{{ provider.area ? provider.area : '' }}</div>
              </div>

              <!-- 所在街道 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">所在街道</div>
                <div>{{ provider.street ? provider.street : '' }}</div>
              </div>

              <!-- 头像 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">头像</div>
                <div class="aui-flex-goods">
                  <img :src="provider.storeAvatar" alt="">
                </div>
              </div>
            </div>
          </div>

          <!-- 玫丽测评师 -->
          <div v-if="editBtn_show">
            <div class="aui-flex aui-choice-white b-line u-font-bold u-pt-20 gap-container">
              <div class="gap-content">
                玫丽测评师
              </div>
              <u-image class="gap-icon" width="40rpx" height="40rpx"
                       src="https://www-1308272144.cos.ap-guangzhou.myqcloud.com/Meily/img/customer_info_edit.png"
                       @click="EvaluationRegister('edit')"
              ></u-image>
            </div>
            <div>
              <!-- 测评喜好【主】品类 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">测评喜好</div>
                <div class="u-flex u-col-center">
                  <div class="u-scroll-x u-mr-5" style="width: 250rpx;"
                       v-if="evaluator.mainCategory || evaluator.secondCategory">
                    <u-tag
                        v-for="(item, index) in evaluator.mainCategory.split(',')"
                        :key="index"
                        :text="item"
                        type="info"
                        mode="dark"
                        size="mini"
                    ></u-tag>
                    <u-tag
                        v-for="(item, index) in evaluator.secondCategory.split(',')"
                        :key="index"
                        :text="item"
                        type="info"
                        mode="dark"
                        size="mini"
                    ></u-tag>
                  </div>
                  <div v-else>-无-</div>
                </div>
              </div>

              <!-- 兴趣领域 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">兴趣领域</div>
                <div class="u-flex u-col-center">
                  <div class="u-scroll-x u-mr-5" style="width: 450rpx;" v-if="evaluator.interests">
                    <u-tag
                        v-for="(item, index) in evaluator.interests.split(',')"
                        :key="index"
                        :text="item"
                        type="info"
                        mode="dark"
                        size="mini"
                    ></u-tag>
                  </div>
                  <div v-else>-无-</div>
                </div>
              </div>

              <!-- 抖音平台 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">抖音平台</div>
                <div>{{ evaluator.tiktok ? evaluator.tiktok : '-无-' }}</div>
              </div>

              <div v-if="evaluator.tiktok == '有'">
                <div class="aui-flex aui-choice-white b-line">
                  <div class="aui-flex-box">抖音粉丝数</div>
                  <div>{{ evaluator.tiktokFans ? evaluator.tiktokFans : '-无-' }}</div>
                </div>

                <div class="aui-flex aui-choice-white b-line">
                  <div class="aui-flex-box">抖音获赞数</div>
                  <div>{{ evaluator.tiktokLikes ? evaluator.tiktokLikes : '-无-' }}</div>
                </div>
              </div>

              <!-- 小红书平台 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">小红书平台</div>
                <div>{{ evaluator.littleRedBook ? evaluator.littleRedBook : '-无-' }}</div>
              </div>

              <div v-if="evaluator.littleRedBook == '有'">
                <div class="aui-flex aui-choice-white b-line">
                  <div class="aui-flex-box">小红书粉丝数</div>
                  <div>{{ evaluator.littleRedBookFans ? evaluator.littleRedBookFans : '-无-' }}</div>
                </div>

                <div class="aui-flex aui-choice-white b-line">
                  <div class="aui-flex-box">小红书获赞与收藏数</div>
                  <div>{{ evaluator.littleRedBookLikes ? evaluator.littleRedBookLikes : '-无-' }}</div>
                </div>
              </div>

              <!-- 其他社交平台 -->
              <div class="aui-flex aui-choice-white b-line">
                <div class="aui-flex-box">
                  <div class="aui-flex-box">其他社交平台</div>
                  <div style="width: auto;margin-top: 10px;height: 150rpx;">
                    <div>{{ evaluator.otherPlatforms ? evaluator.otherPlatforms : '-无-' }}</div>
                  </div>
                </div>
              </div>

            </div>

          </div>

        </div>
      </section>

      <div style="height: 80rpx;"></div>

      <div style="position: fixed;bottom: 0rpx;background-color: #fffbfe;width: 100%;z-index: 3;">

        <div v-if="indexbtn_show">
          <div class="aui-flex-box" v-if="sharebtn_show">
            <ShareBtn :docUnid="shareData.docUnid" :url="shareData.shareAddress" :route="shareData.route"
                      :style="shareData.style"></ShareBtn>
          </div>
          <div class="u-pt-20 u-pb-40" style="width: 90%;margin: 0 auto;height: 130px;">
            <!--            <div>-->
            <!--              <u-button type="success" shape="circle" @click="Save">-->
            <!--                保存-->
            <!--              </u-button>-->
            <!--            </div>-->

            <div style="margin-top: 10px;">
              <u-button type="primary" shape="circle" @click="GoToIndex">
                去首页
              </u-button>
            </div>
          </div>
        </div>

        <div v-else>
          <div class="u-pt-20" style="width: 90%;margin: 0 auto;height: 70px;" v-if="editBtn_show">
            <div class="policy u-pt-5 u-pb-10">玫丽平台将严格按照<span @click="showPolicy">《隐私政策》</span>的各项条款使用和保护您的个人信息。</div>
            <div class="aui-flex-box" v-if="sharebtn_show">
              <ShareBtn :docUnid="shareData.docUnid" :url="shareData.shareAddress" :route="shareData.route"
                        :style="shareData.style"></ShareBtn>
            </div>
          </div>
          <div class="u-pt-20" style="width: 90%;margin: 0 auto;height: 70px;" v-else>
            <div class="policy u-pt-5 u-pb-10">玫丽平台将严格按照<span @click="showPolicy">《隐私政策》</span>的各项条款使用和保护您的个人信息。</div>
          </div>
        </div>
      </div>

    </section>

    <!-- 区域服务商申请和权益说明 -->
    <u-modal v-model="recruit_show" confirm-text="已知晓" title="区域服务商申请和权益说明" confirm-color="#eb5468"
             @confirm="goToApplyProvider">
      <div class="slot-content2">
        <div class="u-title">· 资格申请及收益：</div>
        <p>1、所有用户自动赋予线上服务商资格。</p>
        <p>2、用户须提交申请，方可获得区域服务商资格。</p>
        <p>3、按照“省-市-县区-街道-社区”的5级分类，确定区域归属。</p>
        <p>4、区域服务商可获得工作报酬，团购返利，区域奖励等最大化收益。</p>
        <div class="u-title u-pt-5">· 玫丽责任及义务：</div>
        <p>5、玫丽提供优质品牌方的推广、销售、服务等工作机会。</p>
        <p>6、工作机会创造的工作价值，将按照区域归属和业绩占比等条件，自动分配。</p>
        <div class="u-title u-pt-5">· 区域服务商责任及义务：</div>
        <p>7、积极参与平台发布的工作机会，传播及引导区域内的用户参与，共同创造工作价值。</p>
        <div class="u-title u-pt-5">· 区域服务商资格取消及升级：</div>
        <p>8、区域服务商，每申请一次，授权期限为6个月。逾期后，需重新申请。</p>
        <p>9、区域服务商可申请成为“街道”级别的唯一服务商，详情请联系客服。</p>
        <p>10、区域服务商可申请成为“县区级”级别的业务合伙人，详情请联系客服。</p>
        <p>11、已有“县区级”业务合伙人的区域，不再设立“街道”唯一服务商。</p>
        <p>12、“街道”唯一服务商和“县区级”业务合伙人，需达到相应工作指标。不达标者，平台取消授权。</p>
      </div>
    </u-modal>

    <!-- 隐私政策 -->
    <u-modal v-model="policy_show" confirm-text="已知晓" title="隐私政策" confirm-color="#eb5468">
      <div class="slot-content3">
        <scroll-view scroll-y="true" style="height: 800rpx;">
          <div>
            为切实保护用户个人信息，广州市开放邑软件科技有限公司（以下或称“我们”）根据现行法规及政策，就“玫丽女性工作平台”制定《隐私政策》（“本隐私政策”）。本隐私政策适用于我们通过“玫丽女性工作平台”向您提供的所有服务，以及使用“玫丽女性工作平台”的全部用户。
          </div>
          <div>我们深知个人信息对您的重要性，并会尽全力提供安全可靠的个人信息保护服务，并将恪守以下原则：权责一致原则、目的明确原则、选择同意原则、最少够用原则、确保安全原则、主体参与原则、公开透明原则等。</div>
          <div>请在使用“玫丽女性工作平台”前仔细阅读并了解本《隐私政策》。</div>
          <div class="u-font-bold">一、我们如何收集和使用您的个人信息</div>
          <div>“玫丽女性工作平台”仅会出于必要的业务场景，收集和使用您的个人信息 ，以便向你提供对应的服务，若您不提供相关的个人信息，将无法享受相应的服务内容，以下为部分场景及其获取信息示例。</div>
          <div>
            产品功能：在使用存储服务时，会获取一些必要信息。如：获取您的手机号码用于注册；获取您的手机存储状态用于创建本地目录；在使用照片、视频、文件和通讯录等备份功能时和文件预览及传输时，读取对应的本地文件信息；查看网络状态用于登录和绑定设备。
          </div>
          <div>系统权限：为提供更好的服务体验，我们会向您申请一些系统权限。如：获取存储权限用于 传输文件；获取相机权限用于拍照上传和扫一扫；获取麦克风权限用于绑定对应设备的语音对讲。</div>
          <div>您的个人信息大部分是由您主动向我们提供或授权的，也有我们在您使用我们的产品或服务时通过Cookies、SDK及类似技术获取的。我们会采取一切合理可行的措施，保护您在平台内的个人信息。</div>
          <div class="u-font-bold">二、我们如何使用Cookie和同类技术</div>
          <div>为确保小程序正常运转，我们会在您的移动设备上存储名为Cookie的小数据文件。Cookie通常包含标识符、站点名称以及一些号码和字符。借助于Cookie，网站能够存储您的偏好或购物篮内的商品等数据。</div>
          <div>我们不会将Cookie用于本隐私政策所述目的之外的任何用途。您可根据自己的偏好管理或删除Cookie。</div>
          <div class="u-font-bold">三、个人信息的共享、转让、公开披露</div>
          <div>我们不会向“玫丽女性工作平台”以外的任何公司、组织和个人分享或向其转让，或公开披露您的个人信息。</div>
          <div class="u-font-bold">四、您的权利</div>
          <div>按照中国相关的法律、法规、标准，我们保障您对自己的个人信息行使法定权利。</div>
          <div class="u-font-bold">五、对未成年人个人信息的特别保护</div>
          <div>我们不会收集包括未成年人在内的个人信息。尽管当地法律和习俗对儿童的定义不同，但我们将不满14周岁的任何人均视为儿童。</div>
          <div class="u-font-bold">六、您的个人信息如何在全球范围转移</div>
          <div>我们不会将您的个人信息转移到除中国（仅为本隐私政策之目的，不含香港、澳门与台湾地区）外的其他国家／地区。</div>
          <div class="u-font-bold">七、本隐私政策如何更新</div>
          <div>我们可能会不时地更新本隐私政策。未经您明示同意，我们不会削减您在本隐私政策所享有的权利。我们会在本页面发布对本隐私政策所做的任何变更。</div>
          <div>对于重大变更，我们会向您提供显著的通知。</div>
          <div>
            <p>本隐私政策所指的重大变更包括但不限于：</p>
            <p>1、我们的服务模式发生重大变化。例如收集、处理、使用、共享您的个人信息；</p>
            <p>2、您参与个人信息处理方面的权利及其行使方式发生重大变化；</p>
            <p>3、我们负责处理个人信息安全的联络方式及投诉渠道发生变化时。</p>
          </div>
          <div class="u-font-bold">八、如何联系我们</div>
          <div>如果您对本隐私政策有任何疑问、意见或建议，请通过以下方式联系我们：</div>
          <div>邮箱：【perpartner@openea.net】</div>
          <div>一般情况下，我们将在十五个工作日内回复您的疑问、意见或建议。</div>
          <div>如果您对我们的回复不满意，特别是认为我们的个人信息处理行为损害了您的合法权益，请务必告知我们。</div>
        </scroll-view>
      </div>
    </u-modal>

    <!-- 隐私政策 -->
    <u-modal v-model="openCustomerService_show" confirm-text="确定" title="提示" confirm-color="#eb5468"  @confirm="openServiceChat">
      <div class="slot-content3">
        <div>
          暂不可自行修改，已为您转接人工客服
        </div>
      </div>
    </u-modal>

    <u-popup v-model="identity_show" mode="center" border-radius="14" width="400rpx" height="400rpx">
      <div
          style="width: 100%;height: 400rpx;display: flex;flex-direction: column;justify-content: center;align-items: center;">
        <div v-if="!provider.id">
          <u-button type="error" plain @click="RecruitProvider">区域服务商</u-button>
        </div>
        <div class="u-pt-15" v-if="!editBtn_show">
          <u-button type="error" plain @click="EvaluationRegister('')">玫丽测评师</u-button>
        </div>
      </div>
    </u-popup>

  </div>
</template>

<script>
import shareMixins from '@/mixins/share';
import globalData from "@/globalData";

export default {
  mixins: [shareMixins],
  data() {
    return {
      form: {
        id: '',
        userId: '',
        userName: '',
        realName: '',
        avatarUrl: '',
        sex: '',
        ageGroup: '',
        identityJob: '',
        monthlyIncome: '',
        phoneNumber: '',
        region: "",
        streetVillage: "",
        address: '',
        openid: '',
        unionid: '',
        subscriptionOpenid: ''
      },
      SexList: [],
      AgeGroupList: [],
      IdentityJobList: [],
      MonthlyIncomeList: [],
      list: [],// 街道列表
      visible1: false,// 性别
      visible2: false,// 年龄层
      visible3: false,// 身份职业
      visible6: false,// 月收入
      area_show: false,// 所在地区
      street_show: false,// 所在街道
      indexbtn_show: false,// 点击保存次数超过1次则显示
      sharebtn_show: false,
      fromshare: '', // 是否来自分享
      shareData: {
        docUnid: '',
        shareAddress: '',
        route: '',
        style: 2
      },
      title: '个人资料',
      background: {
        backgroundColor: '#f3e4e9',
      },
      customStyle: {
        background: '#eb5468 !important'
      },
      basicFormDisabled: true,
      provider: {},// 区域服务商
      evaluator: {},// 测评师
      recruit_show: '',// 区域服务商申请和权益说明
      regionalProvider_show: 1, // 是否显示"区域服务商"，默认显示
      onlineProvider_show: 1, // 是否显示"线上服务商"，默认显示
      identity_show: false,
      evaluation_show: 1, // 是否显示"玫丽测评师"，默认显示
      policy_show: false,
      editBtn_show: false,
      frombusiness: '0', // 是否来自业务。0:不是；1:是
      openCustomerService_show:false,
    };
  },

  onLoad(options) {

    // 未登录跳转到登录页面
    var loginRes = this.checkLogin()
    if (!loginRes) {
      return false;
    }

    // 是否显示"区域服务商"
    if (this.isNotNull(options.regionalProvider_show)) {
      this.regionalProvider_show = options.regionalProvider_show;
    }

    // 是否显示"玫丽测评师"
    if (this.isNotNull(options.evaluation_show)) {
      this.evaluation_show = options.evaluation_show;
    }

    // 判断是否从分享进来的
    if (this.isNotNull(options.fromshare)) {
      this.fromshare = options.fromshare;
    }

    if (this.evaluation_show == 1 && this.regionalProvider_show == 0 && this.onlineProvider_show == 0) {
      this.title = "玫丽测评师资料";
    }

    if (this.onlineProvider_show == 1 && this.regionalProvider_show == 0 && this.evaluation_show == 0) {
      this.title = "线上服务商资料";
    }

    // 判断是否从业务检验测评师资料未完善进来的
    if (this.isNotNull(options.frombusiness)) {
      this.frombusiness = options.frombusiness;
    }


    // 初始化下拉选择的值
    this.initSelectList();

    // 获取个人基本资料
    this.getBasicInfo();

    // 获取测评师资料
    this.getEvaluatorInfo();

    // 获取区域服务商信息
    this.getProviderInfo();

    // 分享组件数据初始化
    this.shareData.docUnid = '1579660979812306944'// 固定值，对应AppletInterface_SpecialShare表中的WF_OrUnid
    this.shareData.shareAddress = '/pages_tabbar_contact/personal_contact/EvaluatorInfo?fromshare=1'
    this.shareData.route = this.getCurrentPageUrl(this)

  },

  mounted() {

  },

  onShow() {

    // 获取基本信息
    this.getBasicInfo();

    // 获取测评师资料
    this.getEvaluatorInfo();

    // 获取区域服务商信息
    this.getProviderInfo();
  },

  methods: {

    /**
     * 初始化下拉选择的值（BPM）
     */
    async initSelectList() {
      const userInfo = uni.getStorageSync('userInfo');
      let result = await this.$u.api.unifyRequest({
        userId: userInfo.userId,
        nickName: userInfo.nickName,
        appid: 'Archives',
        wf_num: 'R_Archives_B001',
        loading: false // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      result = JSON.parse(JSON.stringify(result));
      if (result.code == 200) {
        this.SexList = result.data.SexList;
        this.AgeGroupList = result.data.AgeGroupList;
        this.IdentityJobList = result.data.IdentityJobList;
        this.MonthlyIncomeList = result.data.MonthlyIncomeList;
      }
    },

    /**
     * 获取基本信息
     */
    async getBasicInfo() {
      const userInfo = uni.getStorageSync('userInfo');
      let result = await this.$u.api.unifyMiniRestGet({
        systemid: "meily",
        url: "/customer/applet/info/" + userInfo.userId,
        loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      if (result.code == 200) {
        if (this.isNotNull(result.data)) {
          this.form = result.data;
        }

        // 初始化用户信息
        this.form.userId = userInfo.userId;
        this.form.userName = userInfo.nickName;
        this.form.avatarUrl = userInfo.avatarUrl;
        this.form.openid = userInfo.openid;
        this.form.unionid = userInfo.unionid;

        // 获取街道列表（BPM）
        let result2 = await this.$u.api.unifyRequest({
          userId: userInfo.userId,
          nickName: userInfo.nickName,
          appid: 'Archives',
          wf_num: 'R_Archives_BL027',
          Regin: this.form.region,
          loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
        });
        if (result2.code == 200) {
          this.list = result2.data
        }
      } else {
        this.$u.toast(result.msg)
        setTimeout(() => {
          this.goBack()
        }, 2500)
      }
    },

    /**
     * 获取区域服务商信息
     */
    async getProviderInfo() {
      let result = await this.$u.api.unifyMiniRest({
        systemid: "meily",
        url: "/provider/info",
        userId: uni.getStorageSync('userInfo').userId,
        loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      if (result.code == 200 && result.data) {
        this.provider = result.data;
      }
    },

    /**
     * 获取测评师资料
     */
    async getEvaluatorInfo() {
      const userInfo = uni.getStorageSync('userInfo');
      let result = await this.$u.api.unifyMiniRest({
        systemid: "meily",
        url: "/personalInfo/getPersonalInfo",
        userId: userInfo.userId,
        loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      if (result.code == 200) {
        if (this.isNotNull(result.data)) {
          this.evaluator = result.data;
          this.editBtn_show = true
        }
      } else {
        this.$u.toast(result.msg)
        setTimeout(() => {
          this.goBack()
        }, 2500)
      }
    },

    /**
     * 保存个人基本资料（无需校验）
     */
    async Save() {
      const userInfo = uni.getStorageSync('userInfo');
      let result = await this.$u.api.unifyMiniRest({
        systemid: "meily",
        url: "/customer/applet/update",
        id: this.form.id,
        userId: this.form.userId,
        userName: this.form.userName,
        realName: this.form.realName,
        avatarUrl: this.form.avatarUrl,
        sex: this.form.sex,
        ageGroup: this.form.ageGroup,
        identityJob: this.form.identityJob,
        introduction: this.form.introduction,
        monthlyIncome: this.form.monthlyIncome,
        phoneNumber: this.form.phoneNumber,
        region: this.form.region,
        streetVillage: this.form.streetVillage,
        address: this.form.address,
        openid: this.form.openid,
        unionid: this.form.unionid,
        subscriptionOpenid: "",
        loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      if (result.code == 200) {
        this.basicFormDisabled = true;
        this.$u.toast(result.msg)
        // true:已填写完毕；false:尚未填写完毕
        if (result.data) {
          // 扫码进入的
          if (this.fromshare == "1") {
            this.indexbtn_show = true;
          } else {
            // 不是扫码进入的
            setTimeout(() => {
              this.goBack()
            }, 2500)
          }
        }
      } else {
        this.showMSG('error', result.msg)
      }
    },

    /**
     * 去首页
     */
    async GoToIndex() {
      uni.reLaunch({url: '/pages/index/index'});
    },

    /**
     * 获取用户手机号码
     * @param {Object} e
     */
    async getPhoneNumber(e) {
      let loginRes = this.checkLogin();
      if (loginRes) {
        let result = await this.$u.api.unifyMiniRest({
          systemid: "meily",
          url: "/applets/getPhoneNumber",
          code: e.detail.code
        });
        if (result.code == 200) {
          this.$u.toast("获取手机号码成功！");
          this.form.phoneNumber = result.data;
        } else {
          this.$u.toast("获取手机号码失败！");
        }
      }
    },

    /**
     * 将数组中的某个元素更改为选中/取消状态
     */
    isExistInArr(arr, item, isSelect) {
      let flag = false
      arr.forEach((titem) => {
        if (item.label == titem.label) {
          if (isSelect != 'N') {
            titem.isSelect = isSelect
          }
        }
      });
      return flag
    },

    /**
     * 确认选择地区
     * @param {Object} event
     */
    async confirmRegion(event) {
      this.form.region = event.province.label + '-' + event.city.label + '-' + event.area.label;
      this.form.streetVillage = "";

      if (this.isNotNull(event.area.value)) {

        // 先清空数组
        this.list.splice(0, this.list.length);

        // 获取街道列表
        const userInfo = uni.getStorageSync('userInfo');
        let result = await this.$u.api.unifyRequest({
          userId: userInfo.userId,
          nickName: userInfo.nickName,
          appid: 'Archives',
          wf_num: 'R_Archives_BL027',
          provinceCode: event.province.value,
          cityCode: event.city.value,
          areaCode: event.area.value,
          loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
        });
        if (result.code == 200) {
          this.list = result.data
        }
      }
    },

    /**
     * 确认选择街道乡镇
     * @param {Object} event
     */
    confirm(event) {
      this.form.streetVillage = event[0].label + '-' + event[1].label;
    },

    /**
     * 弹窗显示“区域服务商申请和权益说明”
     */
    RecruitProvider() {
      this.identity_show = false;
      this.recruit_show = true;
    },

    /**
     * 前往“申请区域服务商”
     */
    goToApplyProvider() {
      this.$u.route('/pages_tabbar_contact/personal_contact/VPSRegister');
    },

    /**
     * 隐私政策弹窗
     */
    showPolicy() {
      this.policy_show = true
    },

    /**
     * 前往“申请玫丽测评师”
     */
    async EvaluationRegister(action) {
      this.identity_show = false;
      // 检验基本资料是否已填写完毕
      const userInfo = uni.getStorageSync('userInfo');
      let result = await this.$u.api.unifyMiniRestGet({
        systemid: "meily",
        url: "/customer/applet/finish/" + userInfo.userId,
        loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      if (result.code == 200 && result.data) {
        let url = '/pages_tabbar_contact/personal_contact/EvaluationRegister?form=' + encodeURIComponent(JSON.stringify(this.form));
        if (action == 'edit') {// 修改测评师资料
          url += '&action=edit';
        }

        if (this.frombusiness == '1') {// 来自业务
          url += '&frombusiness=' + this.frombusiness;
        }
        this.$u.route(url);
      } else {
        this.$u.toast("请先完善基本资料，并保存！");
      }
    },
    /**
     * 点击联系客服
     */
    async openServiceChat() {
      let result = await this.$u.api.unifyMiniRestGet({
        systemid: "meily",
        url: "/qyapi/kf/account/url/".concat(globalData.openKfid_customized),
        loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
      });
      if (result.code == 200) {
        const pages = getCurrentPages(); // 获取栈实例
        //当前页面路径(带参数)
        let currentPage = pages[pages.length - 1]['$page']['fullPath']
        let kfUrl = result.data
        wx.openCustomerServiceChat({
          extInfo: {
            url: kfUrl
          },
          corpId: globalData.corpId,
          showMessageCard: true,
          sendMessagePath: currentPage,
          success(res) {
            console.log(res)
          }
        })
      } else {
        this.showMSG('error', '出错啦！');
      }
    },
  },
};
</script>

<style scoped>
.gap-container {
  display: flex;
  align-items: center;
}

.gap-content {
  flex: 1;
}

.gap-icon {
  margin-left: auto;
}

.gap-save-btn {
  margin-left: auto;
  color: #eb5468;
}

aui-flexView {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
}

.aui-scrollView {
  width: 100%;
  height: 100%;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  margin-top: 0;
}

.aui-navBar {
  height: 44px;
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  z-index: 1002;
  background: #f7f7f7;
}

.b-line {
  position: relative;
}

.b-line:after {
  content: '';
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  border-bottom: 1px solid #e2e2e2;
  -webkit-transform: scaleY(0.5);
  transform: scaleY(0.5);
  -webkit-transform-origin: 0 100%;
  transform-origin: 0 100%;
}

.aui-navBar-item {
  height: 44px;
  min-width: 25%;
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 25%;
  -ms-flex: 0 0 25%;
  flex: 0 0 25%;
  padding: 0 0.9rem;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  color: #353535;
  position: relative;
}

.aui-navBar-item:first-child {
  -webkit-box-ordinal-group: 2;
  -webkit-order: 1;
  -ms-flex-order: 1;
  order: 1;
  margin-right: -25%;
  font-size: 0.9rem;
  font-weight: bold;
}

.aui-navBar-item:last-child {
  -webkit-box-ordinal-group: 4;
  -webkit-order: 3;
  -ms-flex-order: 3;
  order: 3;
  -webkit-box-pack: end;
  -webkit-justify-content: flex-end;
  -ms-flex-pack: end;
  justify-content: flex-end;
}

.aui-center {
  -webkit-box-ordinal-group: 3;
  -webkit-order: 2;
  -ms-flex-order: 2;
  order: 2;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  height: 44px;
  width: 50%;
  margin-left: 25%;
}

.aui-center-title {
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  font-size: 0.95rem;
  color: #333;
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
  border: none;
  float: left;
  background-size: 20px;
  background-repeat: no-repeat;
}

.aui-flex {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  padding: 30rpx 30rpx;
  position: relative;
}

.aui-flex-box {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #333;
}

.aui-flex-triangle {
  position: relative;
  font-size: 14px;
  padding-right: 15px;
}

.aui-flex-triangle:before {
  content: '';
  width: 0;
  height: 0;
  border-width: 5px 0px 5px 8px;
  border-style: solid;
  border-color: transparent transparent transparent #7b7b7b;
  position: absolute;
  top: 6px;
  right: 0;
  border-radius: 1;
}

.aui-choice-white {
  /* background: #fff; */
}

.aui-order-box {
  padding: 10px 20px;
}

.aui-flex-goods {
  margin-right: .8em;
  width: 80px;
  height: 80px;
  line-height: 80px;
  text-align: center;
}

.aui-flex-goods img {
  width: 100%;
  max-height: 100%;
  vertical-align: top;
}

.aui-flex-default {
  background: #f3f1f1;
}

.aui-flex-default h2 {
  font-size: 14px;
  width: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-wrap: normal;
  word-wrap: break-word;
  word-break: break-all;
  padding-bottom: 5px;
}

.aui-flex-default p {
  color: #999999;
  font-size: 12px;
}

.aui-flex-clear {
  padding: 0;
  margin-top: 20px;
}

.aui-flex-clear .aui-flex-box {
  color: #f21956;
  font-weight: bold;
}

.aui-mar15 {
  margin-bottom: 15px;
}

.aui-flex-triangle-clear:before {
  border-color: #fff;
}

.aui-flex-box h2 {
  font-size: 16px;
  padding-bottom: 5px;
}

.aui-flex-box h3 {
  font-size: 14px;
  padding-bottom: 5px;
}

.aui-flex-box p {
  font-size: 12px;
  color: #999;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.aui-bar-footer {
  line-height: 52px;
  height: 52px;
  background: #fff;
  box-shadow: 0 -2px 10px #ddd;
  position: fixed;
  z-index: 999;
  bottom: 0;
  left: 0;
  width: 100%;
}

.aui-btn-button {
  background: #f21956;
  padding: 0 25px;
  color: #fff;
  font-size: 14px;
}

.aui-bar-footer .aui-flex {
  padding: 0;
}

.aui-bar-footer .aui-flex-box {
  padding-left: 15px;
}

.aui-bar-footer .aui-flex-box span {
  font-style: normal;
  color: #f21956;
}

.cnt {
  padding-top: 1px;
  color: #e61111;
  position: relative;
  line-height: 22px;
  font-size: 14px;
  font-weight: 500;
}

.popup-box {
  padding-bottom: 50rpx;
  padding-top: 50rpx;
}

.popup-item {
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  font-size: 33rpx;
}

.discount_info {
  border-bottom: 1px solid black;
  border-left-width: 0;
  border-top-width: 0;
  border-right-width: 0;
  width: 50px;
  height: 30px;
  text-align: center;
  padding-left: 15px;
}

.swipe-content {
  display: flex;
  flex-direction: row;
  background: #fff;
  border-bottom: 1rpx solid #eee;
  line-height: 35px;
}

.slot-content2 {
  font-size: 28rpx;
  /* color: #bcbcbc; */
  text-align: left;
  width: 93%;
  margin: 0 auto;
  padding-top: 20rpx;
  padding-bottom: 20rpx;
}

.slot-content3 {
  font-size: 28rpx;
  /* color: #bcbcbc; */
  text-align: left;
  width: 93%;
  margin: 0 auto;
  padding-top: 20rpx;
  padding-bottom: 20rpx;
}

.slot-content3 div {
  padding-top: 30rpx;
}

.policy {
  font-size: 21rpx;
  color: #9d9d9d;
  text-align: center;
}

.policy span {
  font-weight: bold;
  text-decoration: underline;
}

</style>

